package com.eatme.web.app.article.repository;

import com.eatme.web.app.article.entity.Article;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import java.util.List;

public interface ArticleRepository extends JpaRepository<Article,Integer> {


    @Modifying
    @Query(value = "update Article  set status = 0 where id = :id",nativeQuery=true)
    int updateArticleStatusById(@Param("id") Integer id);

    List<Article> findArticlesByRankingIn(List<Integer> ranks);
}
